<?php
function getToolbar($path, &$toolbar){
    foreach(glob("$path/*", GLOB_ONLYDIR) as $f){
        $name=basename($f);
        $toolbar[$name]=array("onclick"=>"loadTemplate('".$name."')");
        //getTree($f, $tree[$name]);
    }
}
$toolbar=array();
getToolbar("./.achachi", $toolbar);
echo '$this.doClasses(',json_encode($toolbar),');';
